
<html>
    <head>       
        <style>          

          html { background:transparent; }

          div#buttons {
            flow: grid( 1  1  1  1,
                        3  4  5  12,
                        6  7  8  13,
                        9  10 11 14,
                        2  16 16 15 );  
            border-spacing:10dip; 
            size:*;            
          }

          div#buttons > * {
            display:block;
            size:*;
            min-height: 2em;
            font-size: 4vh;
          }

        </style>
    </head>
    <body>
       <h1>Simple Input</h1>  

       <div#buttons>
         <input|text #input>     <!-- 1 --> 
         <button.btn>0</button>  <!-- 2 --> 
         <button.btn>1</button>  <!-- 3 -->        
         <button.btn>2</button>  <!-- 4 -->        
         <button.btn>3</button>  <!-- 5 -->        
         <button.btn>4</button>  <!-- 6 -->        
         <button.btn>5</button>  <!-- 7 -->        
         <button.btn>6</button>  <!-- 8 -->        
         <button.btn>7</button>  <!-- 9 -->        
         <button.btn>8</button>  <!-- 10 -->        
         <button.btn>9</button>  <!-- 11 -->
         <button.btn>+</button>   <!-- 12 -->
         <button.btn>-</button>   <!-- 13 -->
         <button.btn>*</button>   <!-- 14 -->
         <button.btn>/</button>   <!-- 15 -->
         <button.op>=</button>   <!-- 16 -->
       </div>

       <p> Operator Found  <label for="" #prev></label></p>

       <script type="text/tiscript">
            
            var root = view.root;      

            event click $(button.op) {  
              self#prev.text="" 
              self#input.text= view.Operate(self#input.text)                  
            }

            event click $(button.btn)
            {                       
              if (this.text == "+" || this.text == "-"  
               || this.text == "*" || this.text == "/" ) {     
                  if (self#prev.text != "y"){                
                    self#prev.text="y"                   
                  }else{                                     
                    self#input.text= view.Operate(self#input.text)                                
                  }                        
              }
              self#input.text = self#input.text + this.text; 
                         
            }
       </script>

    </body>
</html>